package cc.vv.btpartyjob.partyservice.delegate

import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import cc.vv.baselibrary.view.banner.ImgBannerView
import cc.vv.btpartyjob.partyservice.R
import cc.vv.lkimagecomponent2.LKImage
import cc.vv.lkimagecomponent2.lib.mode.ScaleMode
import cc.vv.mvp.delegate.BaseAppDelegate

/**
 * 党群服务托管类
 * Created by Chen.qi on 2018/10/24.
 */
class PartyServiceMainFragmentDelegate : BaseAppDelegate() {

    override fun initWidget() {
    }

    override fun initLayoutRes(): Int {
        return R.layout.fragment_partyservice_main
    }


    /**
     * 设置banner
     */
    fun setBannerData(list: ArrayList<String>, listTitle: ArrayList<String>, inter: ImgBannerView.ImgBannerClickInter) {
        val bannerView = getView<ImgBannerView>(R.id.ibv_fpm_bannerAll)
        bannerView?.initWHPercentage(351, 166, -1)
        bannerView?.initImgData(list, listTitle, inter)
        bannerView?.initIndicatorView(R.mipmap.icon_point_selector_no, R.mipmap.icon_point_selector_yes, 8, 5)
    }

    /**
     * 设置图片
     */
    fun setBottomPic() {
        val picOne = getView<ImageView>(R.id.iv_fpm_picOne)
        val picTwo = getView<ImageView>(R.id.iv_fpm_picTwo)
        val picThree = getView<ImageView>(R.id.iv_fpm_picThree)
        LKImage.load().scale(ScaleMode.CENTER_CROP).loadAsserts("icon_server_bmfw.png").into(picOne)
        LKImage.load().scale(ScaleMode.CENTER_CROP).loadAsserts("icon_server_lyb.png").into(picTwo)
        LKImage.load().scale(ScaleMode.CENTER_CROP).loadAsserts("icon_server_wxy.png").into(picThree)
    }

    /**
     * 设置统计是否显示
     */
    fun showYGSZStatics(isShow: Boolean) {
        val staticeShow = getView<ImageView>(R.id.iv_fpm_stationThree)
        if (isShow) {
            staticeShow?.visibility = View.VISIBLE
        } else {
            staticeShow?.visibility = View.INVISIBLE
        }
    }

    /**
     * 设置志愿者管理
     */
    fun showVolunteerManagerStatic(isShow: Boolean) {
        val volunteerLibShow = getView<LinearLayout>(R.id.ll_fpm_volunteerLib)
        val volunteerStaticShow = getView<LinearLayout>(R.id.ll_fpm_volunteerStatics)
        val volunteerLine1Show = getView<View>(R.id.viw_fpm_line1)
        val volunteerLine2Show = getView<View>(R.id.viw_fpm_line2)
        if (isShow) {
            volunteerLibShow?.visibility = View.VISIBLE
            volunteerStaticShow?.visibility = View.VISIBLE
            volunteerLine1Show?.visibility = View.VISIBLE
            volunteerLine2Show?.visibility = View.VISIBLE
        } else {
            volunteerLibShow?.visibility = View.INVISIBLE
            volunteerStaticShow?.visibility = View.INVISIBLE
            volunteerLine1Show?.visibility = View.INVISIBLE
            volunteerLine2Show?.visibility = View.INVISIBLE
        }
    }

    /**
     * 设置志愿者管理
     */
    fun showSourceManager(isShow: Boolean) {
        val volunteerManagerShow = getView<LinearLayout>(R.id.ll_fpm_qindanManager)
        if (isShow) {
            volunteerManagerShow?.visibility = View.VISIBLE
        } else {
            volunteerManagerShow?.visibility = View.GONE
        }
    }

}